package com.itzjc.utils;

import java.security.MessageDigest;

/**
 * 普通自封装工具类
 *
 * @className: CommonUtils
 * @date: 2021-06-04 15:25
 **/
public class CommonUtils {

    public static String MD5(String data){
        try{
            MessageDigest md= MessageDigest.getInstance("MD5");
            byte[] array = md.digest(data.getBytes("UTF-8"));
            StringBuffer sb = new StringBuffer();
            for (byte item : array) {
                sb.append(Integer.toHexString((item &0xFF)|0x100).substring(1,3));
            }
            return sb.toString().toUpperCase();
        }catch (Exception e){

        }
        return null;
    }


}
